package top.mcwebsite.playandroid.business.home.api

import kotlinx.coroutines.runBlocking
import org.junit.Test
import top.mcwebsite.playandroid.common.network.api.NetworkService
import top.mcwebsite.playandroid.common.network.api.createApi
import top.mcwebsite.playandroid.home.api.HomeNetworkApi
import top.mcwebsite.playandroid.lib.servicemanager.core.ServiceManager

class TestHomeNetworkApi {

    @Test
    fun `test home network api get banners`() {
        runBlocking {
            val banners = ServiceManager.getService<NetworkService>()
                .createApi<HomeNetworkApi>()
                .getBanners()
            println(banners)
        }
    }

    @Test
    fun `test home network api get articles`() {
        runBlocking {
            val date = ServiceManager.getService<NetworkService>()
                .createApi(HomeNetworkApi::class.java)
                .getArticles(0)
            println(date)
        }
    }
}